﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ThucDonAnNhau
{
    public partial class frmsoluong : Form
    {
        public frmsoluong()
        {
            InitializeComponent();
        }

        private void btnxong_Click(object sender, EventArgs e)
        {
            if (txtsoluong.TextLength == 0 || int.Parse(txtsoluong.Text) == 0)
            {
                MessageBox.Show("Xin cho biết số lượng cụ thể", "Gọi món");
                txtsoluong.SelectAll();
                txtsoluong.Focus();
            }
            else
            {
                Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtsoluong.Text = "0";
            Close();
        }

        private void txtsoluong_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
                Console.Beep();
            }
        }
    }
}
